<HTML>
  <HEAD>
    <TITLE>threadpool Documentation</TITLE>
    <LINK HREF="threadpool.css" REL="stylesheet" TYPE="text/css">
  </HEAD>
  <BODY BGCOLOR="#FFFFFF">

    <DIV CLASS="qindex">
      <TABLE BORDER="0" WIDTH="100%">
        <TR>

          <TD ALIGN="LEFT">
            <B>threadpool</B>
          </TD>
          <TD ALIGN="RIGHT">
            <A CLASS="qindex" HREF="../index.html">Overview</A> |
            <A CLASS="qindex" HREF="../reference/annotated.html">Reference</A> |
            <A CLASS="qindex" HREF="../tutorial/intro.html">Tutorial</A> |
            <A CLASS="qindex" HREF="../examples/intro.html">Examples</A> |
            <A CLASS="qindex" HREF="../design/intro.html">Design</A>
          </TD>

        </TR>
      </TABLE>
    </DIV>
    <DIV CLASS="qindex">
      <TABLE BORDER="0" WIDTH="100%">
        <TR>
          <TD ALIGN="LEFT">
            <B>Reference</B>
          </TD>
          <TD ALIGN="RIGHT">
            <A CLASS="qindex" HREF="annotated.html">Class List</A> |
            <A CLASS="qindex" HREF="functions.html">Member Functions</A> |
            <A CLASS="qindex" HREF="namespacemembers.html">Typedefs</A> |
            <A CLASS="qindex" HREF="files.html">File List</A>
          </TD>
        </TR>
      </TABLE>
    </DIV>
<!-- Generated by Doxygen 1.6.1 -->
  <div class="navpath"><a class="el" href="a00022.html">boost</a>::<a class="el" href="a00023.html">threadpool</a>::<a class="el" href="a00002.html">fifo_scheduler</a>
  </div>
<div class="contents">
<h1>boost::threadpool::fifo_scheduler&lt; Task &gt; Class Template Reference</h1><!-- doxytag: class="boost::threadpool::fifo_scheduler" -->
<p>SchedulingPolicy which implements FIFO ordering.  
<a href="#_details">More...</a></p>

<p><a href="a00025.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef Task&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a></td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#a2173b176c9aea70f1a05015a60beb24c">clear</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#aeac21c003c6973c7ab43b754b3a73af7">empty</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#a8444283f927fbe045bb4f05b9758c2c8">pop</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#a3eb74835370fc37c8b343ecef1260973">push</a> (<a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a> const &amp;task)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#a7c9a75e406bace84f39e76fead919c64">size</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a> const &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#ab530c63c3bd816cded83df3f8cacf704">top</a> () const </td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::deque&lt; <a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a> &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00002.html#ae6582c199202df043c8d801e4cb2b50a">m_container</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;typename Task = task_func&gt;<br/>
 class boost::threadpool::fifo_scheduler&lt; Task &gt;</h3>

<p>SchedulingPolicy which implements FIFO ordering. </p>
<p>This container implements a FIFO scheduling policy. The first task to be added to the scheduler will be the first to be removed. The processing proceeds sequentially in the same order. FIFO stands for "first in, first out".</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>Task</em>&nbsp;</td><td>A function object which implements the operator()(void). </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="a00018_source.html#l00045">45</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>
<hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="aa364fa4b3952a650ce7436d338935d35"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::task_type" ref="aa364fa4b3952a650ce7436d338935d35" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">typedef Task <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::<a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Indicates the scheduler's task type. </p>

<p>Definition at line <a class="el" href="a00018_source.html#l00048">48</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2173b176c9aea70f1a05015a60beb24c"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::clear" ref="a2173b176c9aea70f1a05015a60beb24c" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::clear </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Removes all tasks from the scheduler. </p>

<p>Definition at line <a class="el" href="a00018_source.html#l00100">100</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="aeac21c003c6973c7ab43b754b3a73af7"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::empty" ref="aeac21c003c6973c7ab43b754b3a73af7" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::empty </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Checks if the scheduler is empty. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the scheduler contains no tasks, false otherwise. </dd></dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>Is more efficient than <a class="el" href="a00002.html#a7c9a75e406bace84f39e76fead919c64">size()</a> == 0. </dd></dl>

<p>Definition at line <a class="el" href="a00018_source.html#l00093">93</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a8444283f927fbe045bb4f05b9758c2c8"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::pop" ref="a8444283f927fbe045bb4f05b9758c2c8" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::pop </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Removes the task which should be executed next. </p>

<p>Definition at line <a class="el" href="a00018_source.html#l00067">67</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a3eb74835370fc37c8b343ecef1260973"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::push" ref="a3eb74835370fc37c8b343ecef1260973" args="(task_type const &amp;task)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::push </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a> const &amp;&nbsp;</td>
          <td class="paramname"> <em>task</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Adds a new task to the scheduler. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>task</em>&nbsp;</td><td>The task object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true, if the task could be scheduled and false otherwise. </dd></dl>

<p>Definition at line <a class="el" href="a00018_source.html#l00059">59</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7c9a75e406bace84f39e76fead919c64"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::size" ref="a7c9a75e406bace84f39e76fead919c64" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::size </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the current number of tasks in the scheduler. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of tasks. </dd></dl>
<dl class="remark"><dt><b>Remarks:</b></dt><dd>Prefer <a class="el" href="a00002.html#aeac21c003c6973c7ab43b754b3a73af7">empty()</a> to <a class="el" href="a00002.html#a7c9a75e406bace84f39e76fead919c64">size()</a> == 0 to check if the scheduler is empty. </dd></dl>

<p>Definition at line <a class="el" href="a00018_source.html#l00084">84</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="ab530c63c3bd816cded83df3f8cacf704"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::top" ref="ab530c63c3bd816cded83df3f8cacf704" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a> const&amp; <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::top </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the task which should be executed next. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The task object to be executed. </dd></dl>

<p>Definition at line <a class="el" href="a00018_source.html#l00075">75</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="ae6582c199202df043c8d801e4cb2b50a"></a><!-- doxytag: member="boost::threadpool::fifo_scheduler::m_container" ref="ae6582c199202df043c8d801e4cb2b50a" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Task  = task_func&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::deque&lt;<a class="el" href="a00002.html#aa364fa4b3952a650ce7436d338935d35">task_type</a>&gt; <a class="el" href="a00002.html">boost::threadpool::fifo_scheduler</a>&lt; Task &gt;::<a class="el" href="a00002.html#ae6582c199202df043c8d801e4cb2b50a">m_container</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Internal task container. </p>

<p>Definition at line <a class="el" href="a00018_source.html#l00051">51</a> of file <a class="el" href="a00018_source.html">scheduling_policies.hpp</a>.</p>

</div>
</div>
</div>
    <BR>
    <DIV CLASS="qindex">
      <TABLE BORDER="0" WIDTH="100%">
        <TR>
		  <TD CLASS="tiny" ALIGN="LEFT">Copyright &copy 2005-2008 Philipp Henkel</TD>
          <TD ALIGN="RIGHT">
            <A CLASS="qindex" HREF="../index.html">Overview</A> |
            <A CLASS="qindex" HREF="../reference/annotated.html">Reference</A> |
            <A CLASS="qindex" HREF="../tutorial/intro.html">Tutorial</A> |
            <A CLASS="qindex" HREF="../examples/intro.html">Examples</A> |
            <A CLASS="qindex" HREF="../design/intro.html">Design</A>
          </TD>
        </TR>       
      </TABLE>
    </DIV>  
  </BODY>
</HTML>
